package com.jd.dlc.limit.fallback.backer;

import org.aspectj.lang.ProceedingJoinPoint;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @program: dlc
 * @ClassName DefaultBacker
 * @description:
 * @author: sizegang
 * @create: 2022-05-10
 **/

public class DefaultBacker extends AbsBacker {

    public DefaultBacker() {
    }

    @Override
    public void triggerBacker(HttpServletResponse response, String limitKey, ProceedingJoinPoint point) {
        response.setHeader("Content-Type", "text/html;charset=UTF-8");
        PrintWriter printWriter = null;
        try {
            printWriter = response.getWriter();
            printWriter.println("{\"code\":\"601\",\"msg\":\"大促异常火爆，已优先为您接入快速通道，稍安勿躁，请返回上一页重新尝试下\"}");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            printWriter.close();
        }
    }
}
